home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / fadeinanim.rexx < prev    next >
OS/2 REXX Batch file  |  1995-04-11  |  2KB  |  87 lines

  1. /*************************/
  2. /* Image Engineer script */
  3. /* Fade In Anim          */
  4. /* by Simon Edwards      */
  5. /*************************/
  6.  
  7. Options results
  8. signal on error            /* Setup a place for errors to go */
  9.  
  10. address 'IMAGEENGINEER'
  11. IE_To_Front
  12. TYPE 24bit
  13.  
  14. 'REQUEST "This script generates animation frames of title'||D2C(10)||'image fading in over a background image." "Ok"'
  15.  
  16. 'GET_FILE "Select an Image for background"'
  17. BackFile=result
  18.  
  19. 'GET_FILE "Select an Image for title"'
  20. TitleFile=result
  21.  
  22. 'GET_NUMBER "Enter the number of frames to generate" 1 100 "Ok|Cancel" 10'
  23. NumberOfFrames=RESULT
  24.  
  25. 'GET_FILE "Enter base path and file name"'
  26. BasePath=RESULT
  27.  
  28. 'GET_RENDER COLOUR "Set render options"'
  29. RenderOptions=RESULT
  30.  
  31. 'GET_FILE_TYPE "Select Save format"'
  32. SaveFormat=RESULT
  33.  
  34. 'OPEN "'||BackFile||'"'
  35. BackProject=RESULT
  36.  
  37. 'OPEN "'||TitleFile||'"'
  38. TitleProject=RESULT
  39.  
  40. PROJECT_INFO BackProject WIDTH
  41. BackWidth=RESULT
  42. PROJECT_INFO BackProject HEIGHT
  43. BackHeight=RESULT
  44.  
  45. PROJECT_INFO TitleProject WIDTH
  46. TitleWidth=RESULT
  47. PROJECT_INFO TitleProject HEIGHT
  48. TitleHeight=RESULT
  49.  
  50. XOffset=(BackWidth-TitleWidth)/2
  51. YOffset=(BackHeight-TitleHeight)/2
  52.  
  53. MARK BackProject SECONDARY
  54. MARK TitleProject PRIMARY
  55.  
  56. do i=1 to NumberOfFrames
  57. 'COMPOSITE ' XOffset YOffset 'MIX' (i-1)/(NumberOfFrames-1)*100 'GENLOCK'
  58. Frame=RESULT
  59. 'SET_RENDER' Frame RenderOptions
  60. 'RENDER' Frame
  61. 'SAVE' Frame '"'||BasePath||right(i,3,'0')||'" "'||SaveFormat||'"'
  62. 'CLOSE' Frame
  63. end
  64.  
  65. 'CLOSE' TitleProject
  66. 'CLOSE' BackProject
  67. 'REQUEST "Done, generated ' NumberOfFrames 'frames."'
  68. exit
  69.  
  70. /*******************************************************************/
  71. /* This is where control goes when an error code is returned by IE */
  72. /* It puts up a message saying what happened and on which line     */
  73. /*******************************************************************/
  74. error:
  75. if RC=5 then do            /* Did the user just cancel us? */
  76.     IE_TO_FRONT
  77.     LAST_ERROR
  78.     'REQUEST "'||RESULT||'"'
  79.     exit
  80. end
  81. else do
  82.     IE_TO_FRONT
  83.     LAST_ERROR
  84.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  85.     exit
  86. end
  87.